<?php $this->headScript()->appendFile($this->publicUrl . "Scripts/formsValidation.js"); ?>
<?php $this->headScript()->captureStart(); ?>
function validateQueryForm() {
	var queryFormValidator = new FormValidator('contact');
	
	queryFormValidator.isNotEmpty('email', '<?= $this->translate('isEmpty') ?>');
	queryFormValidator.isEmail('email',
		"<?= $this->validationMessage('emailAddressInvalid') ?>");
		
	queryFormValidator.isNotShorterThan('message', 
		"<?= $this->validationMessage('stringLengthTooShort', '10') ?>", 10);
	queryFormValidator.isNotLongerThan('message', 
		"<?= $this->validationMessage('stringLengthTooLong', '400') ?>", 400);
	
	return queryFormValidator.result;
}
<?php $this->headScript()->captureEnd(); ?>


<h2><?= $this->translate('SendQuery') ?></h2>

<?php $this->form->setAttrib('onsubmit', 'return validateQueryForm();'); ?>
<?= $this->form ?>